package github.sf.mod.calculate.entity;


import github.sf.mod.calculate.Op;

public abstract class Expression extends AstNode implements AstVisitor {
    //当前位置需要一个左值
    boolean shouldBeLeftValue = false;
    //是否是一个左值
    boolean isLeftValue = false;
    //本表达式的常量值
    Object constValue = null;

    /**
     * 将name变为Op
     */
    public Op ofOp(String name) {
        return Op.valueOf(name);
    }

    @Override
    public Object accept(AstVisitor visitor, Object additional) {
        return null;
    }

    @Override
    public Object visit(AstNode astNode, Object additional) {
        return null;
    }

    @Override
    public void dump(int index) {
        int newIndex = index + 1;
        System.out.println(addPrefix(newIndex) + " ");
    }
}
